/**
 * Created by Administrator on 2015/4/9.
 */

function getDeviceWidth(){
    return document.body.clientWidth;
}
function getDeviceHeight(){
    return document.body.clientHeight;
}
function getScrollHeight(){
    return Math.abs($(document).scrollTop());
}
//兼容IE的事件监听
function addHandler(target, eventType, handler){
    if(target.addEventListener){//主流浏览器,W3C
        addHandler = function(target, eventType, handler){
            target.addEventListener(eventType, handler, false);
        };
    }else{//IE,非标准浏览器
        addHandler = function(target, eventType, handler){
            target.attachEvent("on"+eventType, handler);
        };
    }
    //执行新的函数
    addHandler(target, eventType, handler);
}